// 统一注册路由

const fs = require('fs');

const userRoutes = (app) => {
    console.log(app)
    fs.readdirSync(__dirname).forEach(file =>{
        if(file == 'index.js') return;
        const router = require(`./${file}`)
        app.use(router.routes())
        app.use(router.allowedMethods())
    })
}

module.exports = userRoutes
